package dproxy.application.ui.commands;

import java.util.Collection;

/**
 * Every application command must implement this interface.
 */
public interface Command {

    /**
     * @return command description, written at "help" screen
     */
    String description();

    /**
     * Validates if parameters are correct.
     * @param parameters command parameters. They will be stored by this method, 
     * because a Command is not a reusable component
     * @throws ValidationException if validation was not successfull
     */
    void validate(Collection<String> parameters) throws ValidationException;
    
    /**
     * Perform a command confirmation question before executing.
     * If no confirmation is needed, the implementation should
     * simply return 'true'.
     * @return true if user has confirmed the input
     */
    boolean confirm();
    
    /**
     * Execute command.
     */
    void execute();
    
}
